home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v10n17.arc
/
WINVER.ARC
/
WINVER4
< prev
Wrap
Text File
|
1991-09-25
|
1KB
|
40 lines
REM WinVer4
Declare Function GetVersion Lib "kernel" () As Integer
Declare Function GetWinFlags Lib "kernel" () As Long
Declare Function GetSystemMetrics Lib "user" (nIndex As Integer) As Integer
Declare Function GetActiveWindow Lib "user" () As Integer
Declare Sub SendMessage Lib "user" (hWnd As Integer, wMsg As Integer, \
wParam As Integer, lParam As String) ' instead of As Long
Function LO(x)
LO = x Mod 256
End Function
Function HI(x)
HI = Int(x / 256)
End Function
Sub MAIN
FileNew
Font "Helv", 18 ' big font
hwnd = GetActiveWindow
wmSetText = 12 ' WM_SETTEXT message
SendMessage hwnd, wmSetText, 0, "WordBASIC WINVER"
v = GetVersion
' use Mid$(s,2) because Str$() produces leading space
Insert "Windows v. " + Mid$(Str$(LO(v)), 2) + "." + Mid$(Str$(HI(v)), 2)
' Insert inserts string into the document created above with FileNew
debug = GetSystemMetrics(22) ' SM_DEBUG
If debug Then Insert " (Debug)"
Insert Chr$(11) ' newline; InsertPara loses font
flags = GetWinFlags
If flags And 1 = 0 Then Insert "Real mode"
If flags And 16 Then Insert "Standard (286) mode"
If flags And 32 Then Insert "Enhanced (386) mode"
Insert Chr$(11)
End Sub